package com.hkd.common.api.enums;

/**
 * @author HKD
 * @date 2022/9/18 23:55
 */
public enum OrderStatus {
    //待支付
    WAIT_PAY(1),
    //待发货
    WAIT_SHIPPING(2),
    //待收货
    WAIT_RECEIVE(3),
    //待评论
    WAIT_COMMENT(4),
    //已关闭
    CLOSED(5),
    //退款中
    REFUNDING(6)
    ;


    private Integer code;

    OrderStatus(Integer code) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
    public static OrderStatus search(Integer code){
        for (OrderStatus value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
